<?php
/**
 * @orm tablename html_editor_images
 */
class HtmlEditorImage extends  DomArObject {
	
	/**
	 * @orm plugin DomArImage({autoRename=1r})
	 * @orm listener afterAdd afterAddImage
	 */
	public $image;
	/**
	 * @orm plugin DomArImage({autoRename=1r})
	 */
	public $icon;
	/**
	 * @orm text
	 */
	public $name;
	
	public function afterAddImage() {
		if( $this->image->exists() ) {
			$this->image->resize(800,600);
			$this->icon = $this->image->copy();
			$this->icon->resize(100,100,false);
			$this->icon->cut(100,100);
		}
	
	}

}